package psc.model.base.transacao;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table
public class Transferencia {
	public Transferencia() {
		liberacoes = new ArrayList<Liberacao>();
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	@Column(name = "dataTransferencia", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date dataTransferencia;
	@OneToMany(mappedBy = "transferencia", fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
	private Collection<Liberacao> liberacoes;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getDataTransferencia() {
		return dataTransferencia;
	}

	public void setDataTransferencia(Date dataTransferencia) {
		this.dataTransferencia = dataTransferencia;
	}

	public Collection<Liberacao> getLiberacoes() {
		return liberacoes;
	}

	public void setLiberacoes(Collection<Liberacao> liberacoes) {
		this.liberacoes = liberacoes;
	}
}
